package com.tangchao.client.sdh.view
{
	import com.tangchao.client.sdh.definition.DFCardColor;
	
	import flash.display.MovieClip;
	import flash.geom.Point;
	import flash.text.TextField;

	public class NumInfo extends MovieClip
	{
		private var _soundNum:TextField;
		private var _mainCard:MovieClip;
		private var _getNum:TextField;
		
		public function NumInfo()
		{
			init();
		}
		
		private function init()
		{
			_soundNum=getChildByName("tfSoundNum") as TextField;
			_mainCard=getChildByName("mcMainCard") as MovieClip;
			_getNum=getChildByName("tfGetNum") as TextField;
			_soundNum.text  = "0";
			_mainCard.text  = "";
			_getNum.text    = "0";
			_mainCard.stop();
			_mainCard.visible=false;
		}
		
		/*
		*设置主牌
		*/
		public function createMainCard(color:int)
		{
			switch(color)
			{
				case DFCardColor.COLOR_FANGKUAI:
					_mainCard.visible=true;
					_mainCard.gotoAndStop(1);
					break;
				case DFCardColor.COLOR_HONGTAO:
					_mainCard.visible=true;
					_mainCard.gotoAndStop(2);
					break;
				case DFCardColor.COLOR_CAOHUA:
					_mainCard.visible=true;
					_mainCard.gotoAndStop(3);
					break;
				case DFCardColor.COLOR_HEITAO:
					_mainCard.visible=true;
					_mainCard.gotoAndStop(4);
					break;
				default:
					_mainCard.visible=false;
					break;
			}
		}
		
		public function getGlobalMianCardPos():Point
		{
			return new Point(_mainCard.x+this.x, _mainCard.y+this.y);	
		}
		
		/*
		*设置叫的分
		*/
		public function createSoundNum(value:int)
		{
			_soundNum.text=value.toString();
		}
		
		/*
		*设置得到的分
		*/
		public function updataGetNum(value:int)
		{
			_getNum.text=value.toString();
		}
	}
}